import request from '@/utils/request';

const reportTemplateApi = {};

reportTemplateApi.updateName = (params) => {
	return request({
		url: '/platform-api/template/update-name',
		method: 'put',
    data: params,
	})
}
reportTemplateApi.listByApplication = (applicationId) => {
	return request({
		url: '/platform-api/template/list-application/' + applicationId,
		method: 'get',
	})
}
reportTemplateApi.setDfApplication = (id, applicationId) => {
	return request({
		url: '/platform-api/template/set-application/' + id + '?applicationId=' + applicationId,
		method: 'put',
	})
}
reportTemplateApi.downloadCover = (id) => {
	return request({
		url: '/platform-api/template/download-cover/' + id,
		method: 'get',
		responseType: 'arraybuffer',
	})
}
reportTemplateApi.top = () => {
	return request({
		url: '/platform-api/template/top',
		method: 'get',
	})
}
reportTemplateApi.list = () => {
	return request({
		url: '/platform-api/template/list',
		method: 'get',
	})
}
reportTemplateApi.page = (params) => {
	return request({
		url: '/platform-api/template/page',
		method: 'get',
		params: params,
	})
}
reportTemplateApi.get = (id) => {
	return request({
		url: '/platform-api/template/' + id,
		method: 'get',
	})
}
reportTemplateApi.delete = (id) => {
	return request({
		url: '/platform-api/template/' + id,
		method: 'delete',
	})
}
reportTemplateApi.add = (params) => {
	return request({
		url: '/platform-api/template',
		method: 'post',
		data: params
	})
}
reportTemplateApi.update = (params) => {
	return request({
		url: '/platform-api/template',
		method: 'put',
		data: params
	})
}
export default reportTemplateApi